
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>增加机构</title>
		<%@ include file="/commons/css_js_head.jsp"%>
<script type="text/javascript" src="${ctx }/js/cascadeConnectionMenu.js"></script>
<script type="text/javascript" src="${ctx }/js/xindiqu.js"></script>
<script type="text/javascript">
	
	window.onload=function(){//页面加载完毕后执行此方法
	//初始化各级联菜单，setDefaultAreaCode方法通过地区码参数指定默认显示的地区
	
	var dq = document.getElementById("form1_efOrg_orgCode").value;
	new CascadeConnectionMenu().setDefaultAreaCode(dq).//默认显示"越秀区",
											initByArray('efOrg.selA',//内容为省的select元素的name（字符串）或id值
											shengArray,//内容为所有省的数组对象
											'efOrg.selB',//内容为市的select元素的name（字符串）或id值
											shiArray,//内容为所有市的数组对象
											'efOrg.selC',//内容为区的select元素的name（字符串）或id值
											quArray);//内容为所有区的数组对象
	}
		
</script>
<script type="text/javascript">
//复写Url
doSaveUrl = "${ctx }/permission/efOrgAction!doSave.ts";

//保存
function doSave() {
  
	var _form = document.forms[0];
	if (doSaveUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	_form.action = doSaveUrl;
}

//校验数据
$(document).ready(function(){
	
	$.formValidator.initConfig({formid:"form1",alertmessage:true,onerror:function(msg){alert(msg)},onsuccess:function(){doSave();}});
	
	$("#efOrg_orgName").formValidator().inputValidator({min:1,max:64,onerror:"请输入机构名称，且只能在1-64个汉字之间"});
	$("#efOrg_orgCode").formValidator().inputValidator({min:2,max:12,onerror:"请输入机构编码，且只能设置2个字符"});
	//$("#efOrg_orgLevel").formValidator().inputValidator({min:1,onerror:"请选择机构层级"});
	$("#efOrg_dicOrgType").formValidator().inputValidator({min:1,onerror:"请选择机构类型"});
	$("#efOrg_displayNo").formValidator().inputValidator({min:1,onerror:"请输入机构显示顺序"}).regexValidator({regexp:"intege1",datatype:"enum",onerror:"格式不正确"});
	//$("#efOrg_orgDesc").formValidator().inputValidator({min:1,max:512,onerror:"请输入机构描述，且只能在1-512个汉字之间"});

});

</script>

	</head>

	<body style="overflow-y: auto; overflow-x: hidden">
		<div class="mTitle">
			<b class="bbig">增加机构</b> 带
			<b class="fred"> * </b>号为必填项
		</div>

		<s:form action="/permission/efOrgAction!doSave.ts" method="post" id="form1" theme="simple">
		<s:hidden name="efOrg.orgCode"></s:hidden>
		
			<!--list -->
			<div class="mainAdd">
				<table class="addTable">

					<tr>
						<th width="10%">
							<b class="fred">*</b>上级机构：
						</th>
						<td width="40%">
							<s:textfield id="efOrg_parentId" name="efOrg.parentId" theme="simple" cssStyle="background:#ECEEEC" readonly="true" size="50"></s:textfield>
						</td>
					</tr>		
					<tr>
						<th width="10%">
							<b class="fred">*</b>机构名称：
						</th>
						<td width="40%">
							<s:textfield id="efOrg_orgName" name="efOrg.orgName" theme="simple" maxlength="64" size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							<b class="fred">*</b>机构区域：
						</th>
						<td width="40%">
						省：<select name="efOrg.selA" style="width:140" value="" id="efOrg_selA"></select>
 			  市：<select name="efOrg.selB" style="width:140" value="" id="efOrg.selB"></select>
  			  区：<select name="efOrg.selC" style="width:140" value="" id="efOrg.selC"></select>
							<%--<s:textfield id="efOrg_orgCode" name="efOrg.orgCode" theme="simple" maxlength="12" size="50"></s:textfield>--%>
						</td>
					</tr>
					<!--<tr>
						<th width="10%">
							<b class="fred">*</b>机构层级：
						</th>
						<td width="40%">
							<select id="efOrg_orgLevel" name="efOrg.orgLevel">
								<ef:option groupname="DicOrgLevel" selectedValue="${efOrg.orgLevel}" flag="true" link="true"></ef:option>
							</select>
						</td>
					</tr>
					-->
					<tr>
						<th width="10%">
							<b class="fred">*</b>机构类型：
						</th>
						<td width="40%">
							<select id="efOrg_dicOrgType" name="efOrg.dicOrgType">
								<ef:option groupname="DicOrgType" selectedValue="${efOrg.dicOrgType}" flag="true" link="true"></ef:option>
							</select>
						</td>
					</tr>	
					<tr>
						<th width="10%">
							<b class="fred">*</b>显示顺序：
						</th>
						<td width="40%">
								<s:textfield id="efOrg_displayNo" name="efOrg.displayNo" theme="simple" maxlength="3" size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							机构描述：
						</th>
						<td width="40%">
							<s:textfield id="efOrg_orgDesc" name="efOrg.orgDesc" theme="simple" maxlength="512" size="50"></s:textfield>
						</td>
					</tr>

					<tr>
						<th width="10%">
							<b class="fred">*</b>机构状态：
						</th>
						<td width="40%">
							<select name="efOrg.dicOrgIsValid">
								<ef:option groupname="DicOrgIsValid" selectedValue="${efOrg.dicOrgIsValid}" link="true"></ef:option>
							</select>
						</td>
					</tr>					
				</table>
			</div>

			<!--end list -->
			<div class="addToolbar">
				<p>
					<input class="btn" name="btn_confirm" value="确定" type="submit" />
				</p>

			</div>
		</s:form>

<script>
//刷新左边的菜单树
refreshFrame("left");
</script>

	</body>
</html>
